#include "keepalive.h"
#include "ProtocalIdentifier.h"
#include "NetworkCommonFunction.h"

#include <QTime>

KeepAlive::KeepAlive()
	:SenderCommand(GetProtocalIdentifier("KeepAlive"))
{
}

void KeepAlive::constructCommandData(QByteArray &commandData)
{
	commandData.append(FBtoNetworkCharP(m_CommandType),4);

	QTime currentTime = QTime::currentTime();
	QString currentTimeString = currentTime.toString("hh:mm:ss:zzz");

	unsigned long messLen = currentTimeString.size();

	commandData.append(FBtoNetworkCharP(messLen), 4);
	commandData.append(currentTimeString);
}

